//题目：5文钱买一只公鸡，3文钱买一只母鸡，1文钱可以买3只小鸡，现在要用100文钱买100只鸡，
// 那么各有公鸡，母鸡，小鸡多少只？
public class Test44 {
    public static void main(String[] args) {
        int little = 0;
        int male = 0;
        int female = 0;
        for (little = 0; little < 100; little += 3) {
            for (male = 0; male < 100; male++) {
                for (female = 0; female < 100; female++) {
                    if (little + male + female == 100 && little / 3 + male * 5 + female * 3 == 100) {
                        System.out.println("有公鸡：" + male + "只，母鸡：" + female + "只，小鸡：" + little + "只。");
                    }
                }
            }
        }
    }
}
